<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>

<script type="text/javascript">
	// 例一
//	let set = new Set([1,2,4,4,3]);	
//	console.log('set',set);
	
	// 数组去重
	let arr = [2,4,2,4,11,22];
	let set = new Set(arr);
	let newArr = [...set];
	console.log(arr);
	console.log(newArr);
	
	
	// 遍历
	for (let key of set.keys()) {
		console.log('key',key);
	}
	for (let value of set.values()) {
		console.log('value',value);
	}
	for (let entry of set.entries()) {
		console.log('entry',entry);
	}
	
</script>
